package org.jsystemtest.course.tests;

import org.junit.Test;

import jsystem.extensions.analyzers.text.GetTextCounter;
import jsystem.utils.exec.Command;
import jsystem.utils.exec.Execute;
import junit.framework.SystemTestCase4;

public class SystemTimeTests extends SystemTestCase4 {

	@Test
	public void checkSystemTime() throws Exception {
		Command cmd = new Command();
		cmd.setCmd(new String[] { "cmd.exe", "/C", "time" });
		Execute.execute(cmd, false);

		sleep(1000);

		GetTextCounter counter = new GetTextCounter("The current time is");
		analyzer.setTestAgainstObject(cmd.getStdout().toString());
		analyzer.analyze(counter);

		String result = counter.getCounter();

		report.report("Found: " + result);
	}

}
